<?php

App::uses('Component', 'Controller');

class CurlComponent extends Component{
	
	var $curl;
	
	public function __construct($controller, $settings){
		
	}
	
	public function setUrl($url){
		$this->curl = curl_init($url);
		$this->setOption(CURLOPT_RETURNTRANSFER, true);
	}
	
	public function setOption($option, $value){
		curl_setopt($this->curl, $option, $value);
	}
	
	public function setData($data){
		$this->setOption(CURLOPT_POSTFIELDS, $data);
	}
	
	public function sendTransaction(){
		return (curl_exec($this->curl));
	}
	
}